<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var add = function (x) {
      var sum = 1;
      var tmp = function (x) {
        sum = sum + x;
        return tmp;
      }
      // 函数toString方法设置输出此函数时显示的内容
      tmp.toString = function () {
        return sum;
      }
      return tmp;
    }
    console.log(add(1)(2)(3));

    var a = 10;
    function sum() {
      console.log(a)
    }
    sum()

    console.log(parseInt('1', 0));
  </script>
</body>

</html>